home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000201_simon@lia.di.epfl.ch_Mon Jan 31 12:35:14 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  2KB

  1. Received: from liasun6.epfl.ch by cs.umb.edu with SMTP id AA15386
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Mon, 31 Jan 1994 12:35:14 -0500
  3. Received: by liasun6.epfl.ch (Smail3.1.28.1 #58)
  4.     id m0pR2Wm-0002PeC; Mon, 31 Jan 94 18:35 MET
  5. Message-Id: <m0pR2Wm-0002PeC@liasun6.epfl.ch>
  6. Date: Mon, 31 Jan 94 18:35 MET
  7. From: simon@lia.di.epfl.ch (Simon Leinen)
  8. To: "K. Berry" <kb@cs.umb.edu>
  9. Cc: tex-k@cs.umb.edu
  10. Subject: core dumps
  11. In-Reply-To: <199401311110.AA16810@terminus.cs.umb.edu>
  12. References: <199401311110.AA16810@terminus.cs.umb.edu>
  13.  
  14. kb> worsch's last message about the core dumps in kpathsea points the
  15. kb> way to a possible workaround (I haven't tried it myself): In
  16. kb> kpathsea/fn.c, change CHUNK_SIZE from 64 to, say, 512.  If the
  17. kb> problem is in my dynamically growing strings, that ought to avoid
  18. kb> it, because the strings will never have to grow.
  19.  
  20. One thing I noticed is that fn_copy0() in kpathsea/fn.c corrupts the
  21. heap when called with a `len' argument that is >= CHUNK_SIZE.
  22. Maybe this is what happened to us long-filename weenies?
  23. Somebody should try to #define CHUNK_SIZE 2 or something like that, to
  24. verify whether it still works.
  25.  
  26. Regards,
  27. -- 
  28. Simon.
  29.  
  30. *** kpathsea/fn.c    1994/01/31 17:19:29    1.1
  31. --- kpathsea/fn.c    1994/01/31 17:20:36
  32. ***************
  33. *** 25,28 ****
  34. --- 25,29 ----
  35.   #define CHUNK_SIZE 64
  36.   
  37. + #define CHUNK_ROUNDUP(x) (((x) + CHUNK_SIZE - 1) % CHUNK_SIZE * CHUNK_SIZE)
  38.   
  39.   fn_type
  40. ***************
  41. *** 43,47 ****
  42.     fn_type ret;
  43.     
  44. !   FN_ALLOCATED (ret) = CHUNK_SIZE;
  45.     FN_STRING (ret) = xmalloc (FN_ALLOCATED (ret));
  46.     
  47. --- 44,48 ----
  48.     fn_type ret;
  49.     
  50. !   FN_ALLOCATED (ret) = CHUNK_ROUNDUP (len);
  51.     FN_STRING (ret) = xmalloc (FN_ALLOCATED (ret));
  52.